import 'package:taonile/generated/json/base/json_field.dart';
import 'package:taonile/generated/json/my_collect_entity.g.dart';
import 'dart:convert';

@JsonSerializable()
class MyCollectEntity {
  late int code = 0;
  late String msg;
  late MyCollectData data = MyCollectData();

  MyCollectEntity();

  factory MyCollectEntity.fromJson(Map<String, dynamic> json) => $MyCollectEntityFromJson(json);

  Map<String, dynamic> toJson() => $MyCollectEntityToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class MyCollectData {
  @JSONField(name: "current_page")
  late String currentPage;
  late List<MyCollectDataData> data = [];
  late String total;

  MyCollectData();

  factory MyCollectData.fromJson(Map<String, dynamic> json) => $MyCollectDataFromJson(json);

  Map<String, dynamic> toJson() => $MyCollectDataToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}

@JsonSerializable()
class MyCollectDataData {
  late String id;
  late String title;
  late String image;
  late String logo;
  @JSONField(name: "save_num")
  late String saveNum;
  late String price;

  MyCollectDataData();

  factory MyCollectDataData.fromJson(Map<String, dynamic> json) => $MyCollectDataDataFromJson(json);

  Map<String, dynamic> toJson() => $MyCollectDataDataToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}
